#include "inputsetitem.h"
#include "ui_inputsetitem.h"
#include "insettingdlg.h"

InputSetItem::InputSetItem(Input* input,QWidget *parent) :
    QWidget(parent),mInput(input),
    ui(new Ui::InputSetItem)
{
    ui->setupUi(this);
    ui->btn_set->setText(QString::number(input->getNo()).prepend("X"));
    setOptShow();
}

InputSetItem::~InputSetItem()
{
    delete ui;
}

void InputSetItem::setOptShow()
{
    ui->label->setText(mInput->getFuncName());
}

void InputSetItem::on_btn_set_clicked()
{
    InSettingDlg * dlg = new InSettingDlg(mInput);
    connect(dlg,SIGNAL(accepted()),this,SLOT(setOptShow()));
    dlg->exec();
}
